package cn.itcast.nio.c4;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.Channel;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel sc=SocketChannel.open();
        sc.connect(new InetSocketAddress("localhost",8080));
        SocketAddress address=sc.getLocalAddress();
        sc.write(Charset.defaultCharset().encode("1234567890123456789012345678\n"));
        System.in.read();
        //System.out.println("waitint...");
    }
}
